<div class="row animated" ng-class="{true: 'fadeInRight', false:'fadeInLeft'}[currentAnimated]">
  <div class="panel panel-default">
    <div class="panel-heading">
      <a ng-click="discard()" href="javascript:;"><i class="backBtn fa fa-arrow-circle-left"></i></a>
      <span class="panelTitle" ng-bind="ProductForm.title"></span>
    </div>
    <div class="panel-body">
      <form novalidate name="productForm" class="form-horizontal" role="form">
        <div class="form-group" ng-class="{'has-error': productForm.name.$invalid && productForm.name.$dirty}">
          <label class="control-label col-xs-3 col-md-2">商品名称：</label>
          <div class="col-xs-6 col-md-3">
            <input type="text" class="form-control w25c" name="name" placeholder="商品名称" ng-model="inventory.name">
          </div>
           <div class="col-xs-3 col-md-7">
            可不填，后台自动生成
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.category.$invalid && productForm.category.$dirty}">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>商品分类：</label>
          <div class="col-xs-9 col-md-10">
            <select class="form-control w25c" name="category" required ng-model="inventory.category" ng-change="filterChildCategory()">
              <option ng-repeat="item in inventory.categorys" value="{{item.propertyName}}" children="{{item.childrens.length}}">{{item.value}}</option>
            </select>
            <select class="form-control w25c" name="childCategory" ng-model="inventory.childCategory" ng-if="inventory.childCategoryList.length" ng-change="filterSunCategory()" required>
              <option ng-repeat="item in inventory.childCategoryList" value="{{item.propertyName}}" ng-if="item.value != 'thumbnail'">{{item.value}}</option>
            </select>
            <select class="form-control w25c" name="sunCategory" ng-model="inventory.sunCategory" ng-if="inventory.sunCategoryList.length" required>
              <option ng-repeat="item in inventory.sunCategoryList" value="{{item.propertyName}}" ng-if="item.value != 'thumbnail'">{{item.value}}</option>
            </select>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.buyPrice.$invalid && productForm.buyPrice.$dirty}">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>进货价：</label>
          <div class="col-xs-9 col-md-10">
           <input type="number" class="form-control w25c" name="buyPrice" placeholder="进货价" ng-model="inventory.buyPrice" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.markPrice.$invalid && productForm.markPrice.$dirty}">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>市场价：</label>
          <div class="col-xs-9 col-md-10">
           <input type="number" class="form-control w25c" name="markPrice" placeholder="市场价" ng-model="inventory.markPrice" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.stock.$invalid && productForm.stock.$dirty}">
          <label class="control-label col-xs-3 col-md-2">库存：</label>
          <div class="col-xs-9 col-md-10">
            <input type="number" class="form-control w25c fl" name="stock" placeholder="库存" ng-model="inventory.stock" required>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>商品图片：</label>
          <div class="col-xs-9 col-md-10">
            <div class="button btn btn-primary fl" ngf-select="upload($files)" multiple="multiple" ngf-pattern="'image/*'"
              ngf-accept="'image/*'" ngf-max-size="10MB">上传图片</div>
            <a href="javascript:void(0)" class="btn btn-info ml15" ng-click="openPhotoLibs()">图片库</a><span class="clearfix"></span>
            <iconlist></iconlist>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.status.$invalid && productForm.status.$dirty}">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>状态：</label>
          <div class="col-xs-9 col-md-10">
            <select class="form-control w25c" name="status" required ng-model="inventory.status">
              <option ng-repeat="item in inventory.statusList" value="{{item.id}}">{{item.name}}</option>
            </select>
          </div>
        </div>
        <div class="form-group">
          <div class="col-xs-4 col-xs-offset-2">
            <button class="btn btn-primary" ng-click="submitForm()" ng-disabled="productForm.$invalid">保存</button>
            <button class="btn btn-white" ng-click="discard()">取消</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>
<imagepreview></imagepreview>
<upload-task></upload-task>